pub mod utils;
mod user;

pub mod error {
    pub use crate::user::{auth_check::AuthCheckFailureError, UserVerifyError};
}

use user::auth_check::AuthCheckTrait;
pub use user::{
    auth::{User, UserType},
    auth_check::AuthCheck,
    PwdEncoder,
};

#[derive(Debug, Default, Clone, Copy)]
pub struct CustomAuth;

pub type CustomUser = AuthCheck<CustomAuth>;

impl AuthCheckTrait for CustomAuth {
    fn user_type() -> UserType {
        UserType::Custom
    }
}

#[derive(Debug, Default, Clone, Copy)]
pub struct AdminAuth;

pub type AdminUser = AuthCheck<AdminAuth>;

impl AuthCheckTrait for AdminAuth {
    fn user_type() -> UserType {
        UserType::Admin
    }
}
